#!/bin/bash
# SecurityWarning项目环境变量配置脚本
# 使用方法: source ./env_setup.sh

echo "🔧 设置SecurityWarning项目环境变量..."

# ================================
# 🚀 服务器配置
# ================================
export PORT=8080                              # Web服务器端口

# ================================
# 🤖 LLM模型配置
# ================================
export MODEL_NAME="deepseek-chat"             # LLM模型名称
export DEEPSEEK_URL="https://api.deepseek.com/v1"  # DeepSeek API地址
export DEEPSEEK_API_KEY="sk-2bb6a669991540a0931a7c9d37e8d2cd"  # DeepSeek API密钥

# ================================
# 🔍 Elasticsearch配置
# ================================
export ES_HOST="222.186.10.252"               # Elasticsearch主机地址
export ES_PORT="19200"                        # Elasticsearch端口
export ES_SCHEME="http"                       # 连接协议 (http/https)
export ES_USERNAME="elastic"                         # Elasticsearch用户名 (可选)
export ES_PASSWORD="Elastic_zP7cMk"                         # Elasticsearch密码 (可选)

# ================================
# 🤗 HuggingFace模型缓存配置
# ================================
export HF_HOME="$HOME/.cache/huggingface"     # HuggingFace缓存目录
export TRANSFORMERS_CACHE="$HOME/.cache/huggingface/transformers"  # Transformers缓存
export HF_DATASETS_CACHE="$HOME/.cache/huggingface/datasets"       # Datasets缓存

# ================================
# 🔒 SSL/TLS配置 (可选)
# ================================
export ES_VERIFY_CERTS="true"                 # 是否验证SSL证书
export ES_CA_CERTS=""                         # CA证书路径 (可选)
export ES_TIMEOUT="30"                        # 连接超时时间
export ES_MAX_RETRIES="3"                     # 最大重试次数

echo "✅ 环境变量配置完成！"
echo "📋 当前配置:"
echo "   服务器端口: $PORT"
echo "   LLM模型: $MODEL_NAME"
echo "   ES地址: $ES_SCHEME://$ES_HOST:$ES_PORT"
echo "   HF缓存: $HF_HOME"
echo ""
echo "🚀 使用方法:"
echo "   source ./env_setup.sh"
echo "   python run.py"